package test;

import java.util.Scanner;

public class test2 {
    //判断质数
    public static void main(String[] args) {
//        //满足以下条件不是质数(1+2)或(3)
//        //1 非2的偶数
//        //2 奇数(除1和本身)有其他奇数因子
//        //3 2到开根号之间有因子
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        boolean flag = true;

        if (n <= 1 && n % 2 == 0) {
            flag = false;
        } else {
            for (int i = 3; i < n; i += 2) {
                if (n % i == 0 ) {
                    flag = false;
                }
            }
        }
        System.out.println(flag);

    }


}

